﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace LingDong.IndexEntities.Dictionary
{
    public class InvertedListEntityComparer : IEqualityComparer<InvertedListEntity>
    {
        #region IEqualityComparer<InvertedListEntity> 成员

        public bool Equals(InvertedListEntity x, InvertedListEntity y)
        {
            if (Object.ReferenceEquals(x, y)) 
                return true;

            if (Object.ReferenceEquals(x, null) ||
                Object.ReferenceEquals(y, null))
                return false;

            return x.DocID == y.DocID;
        }

        public int GetHashCode(InvertedListEntity obj)
        {
            return obj.DocID.GetHashCode();
        }

        #endregion
    }
}
